#ifndef __BOARD_BASE_H
#define __BOARD_BASE_H
#ifdef  __cplusplus
    extern "C" {
#endif
/*-----------------------------------------------------------------------
|                               Includes                                |
-----------------------------------------------------------------------*/
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
		
#include "main.h"
#include "gpio.h"
#include "usart.h"
//#include "tim.h"
//#include "FreeRTOS.h"
//#include "queue.h"
//#include "task.h"
#include "tim.h"


/*-----------------------------------------------------------------------
|                                define                                 |
-----------------------------------------------------------------------*/
//*** <<< Use Configuration Wizard in Context Menu >>> ***
//<h> setting

//</h>

//*** <<< end of configuration section >>>    ***

typedef struct 
{
	uint16_t bit0:1;
	uint16_t bit1:1;
	uint16_t bit2:1;
	uint16_t bit3:1;
	uint16_t bit4:1;
	uint16_t bit5:1;
	uint16_t bit6:1;
	uint16_t bit7:1;
	uint16_t bit8:1;
	uint16_t bit9:1;
	uint16_t bit10:1;
	uint16_t bit11:1;
	uint16_t bit12:1;
	uint16_t bit13:1;
	uint16_t bit14:1;
	uint16_t bit15:1;
}bit16_t;

#define BIT16(addr) (*(volatile bit16_t*)(addr))//将一个地址强制转换为位域结构体 


/*-----------------------------------------------------------------------
|                             API FUNCTION                              |
-----------------------------------------------------------------------*/

void bsp_MesureTimeStart(uint32_t *timecnt);
uint32_t bsp_MesureTime(uint32_t *timecnt);
void board_base_init(void);
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim);
void SamplingResistorSwitch(uint32_t index);
#ifdef __cplusplus
}
#endif

#endif
